<template>
  <el-menu class="el-menu-demo" mode="horizontal" router>
    <img class="logo" src="../assets/img//logo_nav.svg" alt="" />
    <el-menu-item
      v-for="(item, index) in nav"
      :key="index"
      :index="item.path"
      >{{ $t(item.title) }}</el-menu-item
    >
    <span class="iconfont icon-diqiu" @click="handle"></span>
  </el-menu>
</template>

<script lang="js">
import { defineComponent } from "vue";
import { ElMenu,ElMenuItem } from 'element-plus'
import nav from "../components/nav.json";
import { useI18n } from 'vue-i18n'
export default defineComponent({
  components: {
    ElMenu
  },
  setup() {
    const { locale } = useI18n()
    console.log('locale', locale)
    const handle = () => {
      console.log(locale.value)
      locale.value = 'jp'
    }
    return {
      nav,
      handle
    };
  },
});
</script>

<style lang="scss" scoped>
.el-menu {
  height: 100px;
  line-height: 100px;

  .icon-diqiu {
    cursor: pointer;
    color: rgba(255, 255, 255, 0.6);
  }
  .icon-diqiu:hover {
    color: #fff;
  }
  // background-color: transparent;
  border-bottom: none;
  height: 100px;
  line-height: 100px;
  color: rgba(255, 255, 255, 0.6);
  font-family: Songti SC, Songti SC;
  font-weight: 400;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 80px;
  .el-menu-item {
    height: 100%;
    padding: 0;
    border-bottom: 6px solid transparent;
  }
  .el-menu-item:hover {
    color: #fff;
    background: none;
    border-bottom: 6px solid #ded2a9;
    cursor: pointer;
    transition: 1s;
  }
}
@media (min-width: 1920px) {
  .el-menu {
    font-size: 25px;
    padding: 0 200px;
    img.logo {
      display: inline-block;
      height: 60px;
    }
    .icon-diqiu {
      font-size: 27px;
    }
  }
}

@media (min-width: 1441px) and (max-width: 1919px) {
  .el-menu {
    font-size: 23px;
    padding: 0 130px;
    img.logo {
      display: inline-block;
      height: 55px;
    }
    .icon-diqiu {
      font-size: 25px;
    }
  }
}

@media (min-width: 1200px) and (max-width: 1440px) {
  .el-menu {
    font-size: 21px;
    height: 90px;
    line-height: 90px;
    img.logo {
      display: inline-block;
      height: 50px;
    }
    .icon-diqiu {
      font-size: 23px;
    }
  }
}

@media (min-width: 992px) and (max-width: 1199px) {
  .el-menu {
    font-size: 19px;
    height: 80px;
    line-height: 80px;

    img.logo {
      display: inline-block;
      height: 45px;
    }
    .icon-diqiu {
      font-size: 21px;
    }
  }
}

@media (max-width: 991px) {
  .el-menu {
    font-size: 18px;
    height: 70px;
    line-height: 70px;
    img.logo {
      display: inline-block;
      height: 45px;
    }
    .icon-diqiu {
      font-size: 20px;
    }
  }
}
</style>
